package com.business.common.utils;

import org.apache.commons.lang3.RandomStringUtils;

import java.util.Random;

public class RandomHelper {

	private final static int delta = 0x9fa5 - 0x4e00;
	private final static Random random = new Random();
	
	public static final String chinese(int size){
		StringBuilder builder= new StringBuilder(size);
		for (int i = 0; i < size; i++) {
			char c = (char)(0x4e00 + random.nextInt(delta));
			builder.append(c);
		}
		
		return builder.toString();
	}
	
	/**
	 * 随机数字 
	 */
	public static final String numberic(int size){
		return RandomStringUtils.randomNumeric(size);
	}
	
	/**
	 * 随机字母+数字组合
	 */
	public static final String alphanumeric(int size){
		return RandomStringUtils.randomAlphanumeric(size);
	}
	
	public static void main(String[] args) {
		System.out.println(numberic(33));
	}
	
}
